{% load static %}
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>{{title}}</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

        <link href="{% static "css/bootstrap.min.css"%}"rel="stylesheet">
    <link href="{% static "css/font-awesome.min.css"%}" rel="stylesheet">
    <link href="{% static "css/animate.min.css"%}" rel="stylesheet">
    <link href="{% static "css/style.min.css"%}" rel="stylesheet">
    <link rel="stylesheet" href="{% static "layui/css/layui.css"%}"  media="all">




  <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body class="baise">

<div class="wrapper wrapper-content ">
        <div class="row">
            <div class="col-sm-12">




  {% csrf_token %}
<script>

{% if tishi %}

window.onload=function(){
layer.alert('{{tishi}}', {
  icon: 0,
  skin: 'layer-ext-moon'    , time: 2000, //20s后自动关闭
})
}
{% endif %}

{% if jinggao %}

window.onload=function(){
layer.alert('{{jinggao}}', {
  icon: 2,
  skin: 'layer-ext-moon'    , time: 2000, //20s后自动关闭
})
}
{% endif %}


{% if yes %}

window.onload=function(){
layer.alert('{{yes}}', {
  icon: 1,
  skin: 'layer-ext-moon'    , time: 2000, //20s后自动关闭
})
}
{% endif %}

</script>

<form class="layui-form " method="POST" action="/dngadmin/htmlsetup_post/">
    {% csrf_token %}
  <div class="layui-form-item">
    <label class="layui-form-label">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;首页标题&emsp;&emsp;  </label>
    <div class="layui-input-duan">
      <input type="text" name="{{zd_list.0.1}}" value="{{biaodan.title_str}}"  lay-verify="required" lay-reqtext="必须填写"  autocomplete="off" placeholder="请输入首页标题" class="layui-input">
    </div>
  </div>

<div class="layui-form-item">
    <label class="layui-form-label">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;品牌名称&emsp;&emsp;  </label>
    <div class="layui-input-duan">
      <input type="text" name="{{zd_list.0.2}}" value="{{biaodan.logotitle_str}}"  lay-verify="required" lay-reqtext="必须填写"  autocomplete="off" placeholder="请输入品牌名称" class="layui-input">
    </div>
  </div>

    <div class="layui-form-item">
    <label class="layui-form-label">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;META关键词</label>
    <div class="layui-input-duan">
      <input type="text" name="{{zd_list.0.3}}" value="{{biaodan.keywords_str}}"  lay-verify="required" lay-reqtext="必须填写"  autocomplete="off" placeholder="请输入META关键词" class="layui-input">
    </div>
  </div>


  <div class="layui-form-item">
    <label class="layui-form-label">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;META描述&ensp; &ensp; </label>
    <div class="layui-input-duan">
      <input type="text" name="{{zd_list.0.4}}" value="{{biaodan.description_str}}"  lay-verify="required" lay-reqtext="必须填写"  autocomplete="off" placeholder="请输入META描述" class="layui-input">
    </div>
  </div>


    <div class="layui-form-item">
    <label class="layui-form-label">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;备案号&emsp; &emsp;&ensp;  </label>
    <div class="layui-input-duan">
      <input type="text" name="{{zd_list.0.5}}" value="{{biaodan.file_str}}"   autocomplete="off" placeholder="请输入备案号" class="layui-input">
    </div>
  </div>


    <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;统计代码&emsp; &ensp; </label>
    <div class="layui-input-duan">
      <textarea placeholder="请输入统计代码" name="{{zd_list.0.6}}"  class="layui-textarea">{{biaodan.statistics_text}}</textarea>
    </div>
  </div>

{% if biaodan.register_bool %}

    <div class="layui-form-item">
    <label class="layui-form-label">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;注册开关&emsp; </label>
    <div class="layui-input-duan">
      <input type="checkbox" checked="" name="{{zd_list.0.7}}" lay-skin="switch" lay-text="开放注册|关闭注册">
    </div>

  </div>
{% else %}


    <div class="layui-form-item">
    <label class="layui-form-label">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;注册开关&emsp; </label>
    <div class="layui-input-duan">
      <input type="checkbox" name="{{zd_list.0.7}}" lay-skin="switch" lay-text="开放注册|关闭注册">
    </div>

  </div>
{% endif %}


{% if biaodan.http_bool %}

    <div class="layui-form-item">
    <label class="layui-form-label">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;网站开关&emsp;</label>
    <div class="layui-input-duan">
      <input type="checkbox" checked="" name="{{zd_list.0.8}}" lay-skin="switch" lay-text="开放网站|关闭网站">
    </div>

  </div>
{% else %}


    <div class="layui-form-item">
    <label class="layui-form-label">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;网站开关&emsp;</label>
    <div class="layui-input-duan">
      <input type="checkbox" name="{{zd_list.0.8}}" lay-skin="switch" lay-text="开放网站|关闭网站">
    </div>

  </div>
{% endif %}



  <div class="layui-form-item">
    <div class="layui-input-block">
      <button type="submit" class="layui-btn" lay-submit="" >提交修改</button>
      <button type="reset" class="layui-btn layui-btn-primary">重新填写</button>
    </div>
  </div>
</form>



<script src="{% static "layui/layui.js"%}" charset="utf-8"></script>

<script>
layui.use(['form', 'layedit', 'laydate'], function(){
  var form = layui.form
  ,layer = layui.layer
  ,layedit = layui.layedit
  ,laydate = layui.laydate;

  //日期
  laydate.render({
    elem: '#date'
  });
  laydate.render({
    elem: '#date1'
  });

  //创建一个编辑器
  var editIndex = layedit.build('LAY_demo_editor');

  //自定义验证规则
  form.verify({
    title: function(value){
      if(value.length < 5){
        return '标题至少得5个字符啊';
      }
    }
    ,pass: [
      /^[\S]{6,12}$/
      ,'密码必须6到12位，且不能出现空格'
    ]
    ,content: function(value){
      layedit.sync(editIndex);
    }
  });

  //监听指定开关
  form.on('switch(switchTest)', function(data){
    layer.msg('开关checked：'+ (this.checked ? 'true' : 'false'), {
      offset: '6px'
    });
    layer.tips('温馨提示：请注意开关状态的文字可以随意定义，而不仅仅是ON|OFF', data.othis)
  });

  //监听提交
  form.on('submit(demo1)', function(data){
    layer.alert(JSON.stringify(data.field), {
      title: '最终的提交信息'
    })
    return false;
  });

  //表单赋值
  layui.$('#LAY-component-form-setval').on('click', function(){
    form.val('example', {
      "username": "贤心" // "name": "value"
      ,"password": "123456"
      ,"interest": 1
      ,"like[write]": true //复选框选中状态
      ,"close": true //开关状态
      ,"sex": "女"
      ,"desc": "我爱 layui"
    });
  });

  //表单取值
  layui.$('#LAY-component-form-getval').on('click', function(){
    var data = form.val('example');
    alert(JSON.stringify(data));
  });

});
</script>
  </div>
        </div>
    </div>

</body>
</html>
